package com.example.bbs.agent.cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * author: VC
 * create: 2021/7/16 9:53
 * version: 1.0.0
 */
public class ObjectProxy implements MethodInterceptor {
    @Override
    public Object intercept(Object o,
                            Method method,
                            Object[] objects,
                            MethodProxy methodProxy) throws Throwable {
        System.out.println("调用前");
        Object val = methodProxy.invokeSuper(o, objects);
        System.out.println("调用前");
        return val;
    }
}
